<template>
  <div class="message" v-if="visible">
    <div class="text" :class="type">{{ message }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      type: 'info',
      message: '',
      time: 2000
    };
  }
};
</script>

<style lang="less" scoped>
.message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 20px;
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 5px;
}
.success {
  color: #67c23a;
  border-color: #67c23a;
  background-color: #e1f3d8;
}
.error {
  color: #f56c6c;
  border-color: #f56c6c;
  background-color: #fde2e2;
}
.info {
  color: #909399;
  border-color: #909399;
  background-color: #e9e9eb;
}
</style>
